import os

a={".jpg":0,".jpeng":0,".gif":0,".peng":0}
<<<<<<< HEAD
dir= "/tem/abc"
=======
dir= "/tmp/abc"
>>>>>>> 161a18713881ca5381587a4aba5bf4c56277c4d7
for path,mus,files in os.walk(dir):
     for name in files:
      fname=os.path.splitext(name)[1]
      if fname in a :
       a[fname]=a[fname]+1
for i in a.keys():
    print (i, a[i])
